version 16
set more off
set matsize 11000
 
***************************************************************************************************
*THIS FILE PRODUCES FIGURE A.IV OF SLEMROD-REHMAN-WASEEM-2020, RESTAT
***************************************************************************************************
 
/* PRELIMINARIES */
 
use						"$project_data\ITRM_Dislo_Unique_IncMPs_Light.dta", clear
drop						if treat==1
drop						treat
keep                 regno year TaxPaid we namefreq
duplicates 				drop regno year, force
g                    logtaxpaid=log(TaxPaid)
forvalues            y=2007/2015 {
g                         y_`y'=(year==`y')
}

/* PANLE A: (ALL SELF-EMPLOYED) */

g							treat=we==0
forvalues            y=2007/2015 {
g                    treat_`y'=(treat==1 & year==`y')
}
qui                  areg logtaxpaid y_* treat_2*, absorb(regno) cluster(regno)
g                    betahats=0
g                    cil=0
g                    cih=0
forvalue             y=2007/2015 {
                        cap replace betahats=_b[treat_`y'] if year==`y' 
                        cap replace cil=_b[treat_`y']-1.96*_se[treat_`y'] if year==`y'
                        cap replace cih=_b[treat_`y']+1.96*_se[treat_`y'] if year==`y'
}
bys                  year treat:g index=_n
#d                   ;
twoway               (rarea cil cih year if year>2006 & index==1,sort color(gs14))
							(connected  betahats year if year>2006 & index==1,sort msize(large) msymbol(S) lwidth(thick) lcolor(red) mcolor(red)),
                     xtitle("Tax Year") xscale(titlegap(*10))
                     xlabel(2007(1)2015)
                     yscale(r(0))  yscale(titlegap(*10)) ytitle("Difference-in-differences Coefficient") ylabel(1(-1)-3)
                     xline(2011.5, lpatter(dash) lcolor(green))
                     legend(region(style(none)) label(1 "95% Confidence Interval") label(2 "Coefficient") order(2 1))
                     graphregion(fcolor(white) style(none) color(white) margin(0 2 0 0)) bgcolor(white);
graph                export "$project_output\ChartPDResponse_SEvsWE_I.eps", replace;
#d                   cr


/* PANLE B: (COMMON-NAMED SELF-EMPLOYED) */

use						"$project_data\ITRM_Dislo_Unique_IncMPs_Light.dta", clear
drop						if treat==1
drop						treat
keep                 regno year TaxPaid we namefreq
duplicates 				drop regno year, force
g                    logtaxpaid=log(TaxPaid)
forvalues            y=2007/2015 {
g                         y_`y'=(year==`y')
}

/* PANLE A: (ALL SELF-EMPLOYED) */

g							treat=we==0
drop						if treat==1 & namefreq<=10
forvalues            y=2007/2015 {
g                          treat_`y'=(treat==1 & year==`y')
}
qui                  areg logtaxpaid y_* treat_2*, absorb(regno) cluster(regno)
g                    betahats=0
g                    cil=0
g                    cih=0
forvalue             y=2007/2015 {
                          cap replace betahats=_b[treat_`y'] if year==`y' 
                          cap replace cil=_b[treat_`y']-1.96*_se[treat_`y'] if year==`y'
                          cap replace cih=_b[treat_`y']+1.96*_se[treat_`y'] if year==`y'
}
bys                  year treat:g index=_n
#d                   ;
twoway               (rarea cil cih year if year>2006 & index==1,sort color(gs14))
                     (connected  betahats year if year>2006 & index==1,sort msize(large) msymbol(S) lwidth(thick) lcolor(red) mcolor(red)),
                     xtitle("Tax Year") xscale(titlegap(*10))
                     xlabel(2007(1)2015)
                     yscale(r(0))  yscale(titlegap(*10)) ytitle("Difference-in-differences Coefficient") ylabel(1(-1)-3)
                     xline(2011.5, lpatter(dash) lcolor(green))
                     legend(region(style(none)) label(1 "95% Confidence Interval") label(2 "Coefficient") order(2 1))
                     graphregion(fcolor(white) style(none) color(white) margin(0 2 0 0)) bgcolor(white);
graph                export "$project_output\ChartPDResponse_SEvsWE_II.eps", replace;
#d                   cr


